! ###############################################################
! ###############################################################
! ###                                                         ###
! ###  IOMD system level block models                         ###
! ###                                                         ###
! ###  Created 18/8/92: David Flynn                           ###
! ###                                                         ###
! ###   AMUX - Address Multiplexer                            ###
! ###                                                         ###
! ###############################################################
! ###############################################################
! ###  Revision History:                                      ###
! ###   25/8/92: DWF : ADEC revisions & AMUX from Ashley      ###
! ###   07/9/92: DWF : AMUX spilt from IOMDSYS file           ###
! ###   07/9/92:  AS : Added column address masking (video)   ###
! ###   25/11/92: AS : Removed column address masking (video) ###
! ###   7/1/92:   AS : Major change to speed up four etc      ###
! ###############################################################

FROM StdParts.Misc         IMPORT  $Sink
FROM StdParts.Gates        IMPORT  $SGate1

FROM iomd.amuxblks         IMPORT  $AMUX


! ###############################################################
! dummy tie offs:

BLOCK SNK({IN} s)
  sink = $Sink(z(s, s))
END {SNK}

BLOCK TBDHI({OUT} s)
  tbdhi = $SGate1(Vdd) => s WITH (delay=1, OP=BUFF)
END {TBDHI}

BLOCK TBDLO({OUT} s)
  tbdlo = $SGate1(Vss) => s WITH (delay=1, OP=BUFF)
END {TBDLO}



! ###############################################################
! IOMD AMUX - DRAM address multiplexer
! ###############################################################

BLOCK AMUX(
  {IN}  ramc[2:0],
  {IN}  a[25:2],
  {IN}  da[25:2],
  {IN}  rclk,
  {IN}  cas,
  {IN}  dmagoing,
  {IN}  colmux,
  {IN}  fcolmux, ! Fast column mux to ra mux only
  {OUT} count0,
  {OUT} ra[11:0],
  {OUT} four,
  {OUT} eight,
  {OUT} maxseq
)

amux = $AMUX(
  {IN}  ramc[2:0],
  {IN}  a[25:2],
  {IN}  da[25:2],
  {IN}  rclk,
  {IN}  cas,
  {IN}  dmagoing,
  {IN}  colmux,
  {IN}  fcolmux ! Fast column mux to ra mux only
) => (
  {OUT} count[8:0],
  {OUT} ra[11:0],
  {OUT} four,
  {OUT} eight,
  {OUT} maxseq
)
  WITH (delay = (cnt=ns_9, gt=ns_5, ltch=ns_5, mux=ns_9))

  c0buf = $SGate1(count[0]) => count0 WITH (op=BUFF, delay=ns_1)

  cntsink = $Sink(count[8:1])

END {AMUX}

